package cn.gzjp.modules.gas.entity;

import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

/**
 * 加油用户Entity
 * @author zengcp
 * @version 2018-03-05
 */
public class GasUser extends DataEntity<GasUser> {
	
	private static final long serialVersionUID = 1L;
	private String headImg;		// 头像
	private String nickName;		// 昵称
	private String mobile;		// 手机号
	private Date registTime;		// 注册时间

	private BigDecimal balance;//账户余额
	private int gasCount;//加油次数
	private int scoreCount;//当前积分数
	private BigDecimal discountM;//累积优惠

	private BigDecimal totalL;		// 加油总量L
	private BigDecimal totalM;		// 加油总消费元


	private int scoreTotal;//用户总积分
	private BigDecimal gasTotal;

	public int getScoreTotal() {
		return this.getScoreCount();
	}

	public void setScoreTotal(int scoreTotal) {
		this.scoreTotal = scoreTotal;
	}

	public BigDecimal getGasTotal() {
		return this.getTotalL();
	}

	public void setGasTotal(BigDecimal gasTotal) {
		this.gasTotal = gasTotal;
	}

	public GasUser() {
		super();
	}

	public GasUser(String id){
		super(id);
	}

	@Length(min=0, max=256, message="头像长度必须介于 0 和 256 之间")
	@ExcelField(title="头像", align=2, sort=1)
	public String getHeadImg() {
		return headImg;
	}

	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}
	
	@Length(min=0, max=32, message="昵称长度必须介于 0 和 32 之间")
	@ExcelField(title="昵称", align=2, sort=2)
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	@Length(min=0, max=11, message="手机号长度必须介于 0 和 11 之间")
	@ExcelField(title="手机号", align=2, sort=3)
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="注册时间", align=2, sort=4)
	public Date getRegistTime() {
		return registTime;
	}

	public void setRegistTime(Date registTime) {
		this.registTime = registTime;
	}

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public int getGasCount() {
		return gasCount;
	}

	public void setGasCount(int gasCount) {
		this.gasCount = gasCount;
	}

	public int getScoreCount() {
		return scoreCount;
	}

	public void setScoreCount(int scoreCount) {
		this.scoreCount = scoreCount;
	}

	public BigDecimal getDiscountM() {
		return discountM;
	}

	public void setDiscountM(BigDecimal discountM) {
		this.discountM = discountM;
	}

	public BigDecimal getTotalL() {
		return totalL;
	}

	public void setTotalL(BigDecimal totalL) {
		this.totalL = totalL;
	}

	public BigDecimal getTotalM() {
		return totalM;
	}

	public void setTotalM(BigDecimal totalM) {
		this.totalM = totalM;
	}
}